#ifndef TEXTURE_H
#define TEXTURE_H

#include "Point.h"
#include "Couleur.h"
#include "PPMImage.h"

enum TypeTextureMapping{
	rien, planar, spherical, cyclindrical
};

enum TypeTexture{
	fonctionTexture, imageTexture
};

class Texture
{
protected:
	TypeTextureMapping typeMapping;
	TypeTexture typeTexture;
	PPMImage image;
	Point centre; //pour spherical
	Vecteur vertical;
	Vecteur horizon;
	float coffTexture;
	bool isBillboard;

public:
	Texture();
	Texture(TypeTextureMapping type1);
	Texture(TypeTextureMapping type1, TypeTexture type2, PPMImage image1);
	~Texture();

	bool getTexture();
	void setTextureMapping(TypeTextureMapping type1);
	void setTextureImage(PPMImage image1);
	void setCentreTexture(Point centre1); // pour spherical
	void setVertical(Vecteur vertical1);
	void setHorizon(Vecteur horizon1);
	void setCoffTexture(float coffTexture1);
	void setIsBillboard(bool flag);

	Couleur getCouleurTexture(Point p);
	Couleur getCouleur(float u, float v);
	void getUVPlanar(Point p,float* u, float* v);
	void getUVSpherical(Point p,float* u, float* v);
	void getUVCyclindrical(Point p,float* u, float* v);
};


#endif